package Hw_05;

/**
 * 编写一个Car类，具有String类型的属性品牌，具有功能drive；
 *
 * 定义其子类Aodi和Benchi，具有属性：价格、型号；具有功能：变速；
 *
 * 定义主类E，在其main方法中分别创建Aodi和Benchi的对象并测试对象的特性
 */
public class Car {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public void drive(){

    }
    public class Aodi extends Car{
        public double price;
        public String style;

        Aodi(double price, String style) {
            this.price = price;
            this.style = style;
        }

        public void Speed(double a) {
            System.out.println("速度是：" + a);
        }
    }
    public class Benchi extends Car{
        public double price;
        public String style;

        Benchi(double price, String style) {
            this.price = price;
            this.style = style;
        }

        public void Speed(double b)
        {
            System.out.println("速度是：" + b);
        }
    }

    public static void main(String[] args) {
    }

    }




